<?php
 /*********************************************\
 |* @author Yannic Schnetz, Mike Waldvogel    *|
 |* @copyright Yannic Schnetz, Mike Waldvogel *|
 |*********************************************|
 |* @since 30.07.2013                         *|
 \*********************************************/

$fgroups = array();
$fgquery = $DB->query('SELECT * FROM `speisegruppen` ORDER BY `name` ASC');
while($row = $DB->fetch($fgquery)) {
    $foodquery = $DB->query("SELECT * FROM `preise` WHERE `gruppen_id` = '" . Group::get_groupid_by_name('vesper') . "' AND `speisegruppen_id` = '" . $row['id'] . "' AND `anzeigen` = '1' ORDER BY `name`");
    $row['food'] = array();
    while($row2 = $DB->fetch($foodquery)) {
        $row2['preis'] = str_replace('.', ',', $row2['preis']);
        $row['food'][] = $row2;
    }
    $fgroups[] = $row;
}

$tpl->assign('foodgroups', $fgroups);
?>
